<template lang="pug">
	.action-result-wrap
		.main-result
			.result-icon
				img(src="../../assets/image/healthCard/okIcon.png")
			.result-text {{title}}
			.tip {{info}}
			block(v-for="(item,index) in button" :key="index")
				.action-button(@click="action(item.action)")
					main-button(:text="item.text" isActive="true" :isWhite="item.white")
</template>

<script>
import mainButton from '@/components/main-button'
export default {
	name: 'actionResult',
	data() {
		return {
			title: '',
			info: '',
			button: []
		}
	},
	created() {},
	mounted() {
		let that = this
		this.wx.getStorage({
			key: 'actionResult',
			success(res) {
				that.title = res.data.title
				that.info = res.data.info
				that.button = res.data.button
			}
		})
	},
	methods: {
		action(handle) {
			if (handle === 'bind') {
				//绑卡
				this.$router.push({
					path: '/views/healthCard/bindCard',
					query: {
						name: this.$route.query.name
					}
				})
			} else if (handle === 'done')
				//完成
				this.$router.push({
					path: '/views/healthCard/index'
				})
		}
	},
	components: {
		mainButton
	}
}
</script>

<style lang="stylus">
	.action-result-wrap
		text-align center
		position absolute
		left 0
		top 0
		bottom 0
		right 0
		min-height 600px
		center()
		.main-result
			.result-icon
				width 180px
				height 180px
				margin 0 auto
				position relative
				center()
				img
					width 100%
					height 100%
			.result-text
				padding 36px 0 46px
				font-weight 500
				color blackFontColor1A
				font-size 40px
			.tip
				font-size 28px
				color #aaa
				padding 0 mainPadding 40px
			.action-button
				width 690px
				height 92px
				border-radius 46px
				overflow hidden
				margin 0 auto mainMargin
</style>
